package org.gesplan.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author David
 */
@Entity
@Table(name = "material_work")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MaterialWork.findAll", query = "SELECT m FROM MaterialWork m"),
    @NamedQuery(name = "MaterialWork.findById", query = "SELECT m FROM MaterialWork m WHERE m.id = :id"),
    @NamedQuery(name = "MaterialWork.findByPrice", query = "SELECT m FROM MaterialWork m WHERE m.price = :price"),
    @NamedQuery(name = "MaterialWork.findByAmount", query = "SELECT m FROM MaterialWork m WHERE m.amount = :amount"),
    @NamedQuery(name = "MaterialWork.findByTotal", query = "SELECT m FROM MaterialWork m WHERE m.total = :total")
})
public class MaterialWork implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "price")
    private Float price;
    @Column(name = "amount")
    private Float amount;
    @Column(name = "total")
    private Float total;
    @Column(name = "comments")
    private String comments;


    public MaterialWork() { }

    public MaterialWork(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Float getAmount() {
        return amount;
    }

    public void setAmount(Float amount) {
        this.amount = amount;
    }

    public Float getTotal() {
        return total;
    }

    public void setTotal(Float total) {
        this.total = total;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof MaterialWork)) {
            return false;
        }
        MaterialWork other = (MaterialWork) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.gesplan.entity.MaterialWork[ id=" + id + " ]";
    }
  
    
}